package clone;

import person.DeepPerson;
import person.Money;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 38917
 * Date: 2025/5/11
 * Time: 01:48
 */

public class DeepClone {
    public static void main(String[] args) throws CloneNotSupportedException {
        DeepPerson deepPerson1 = new DeepPerson("李四",20,100,25000);
        DeepPerson deepPerson2 = (DeepPerson) deepPerson1.clone();
        System.out.println(deepPerson1);
        System.out.println(deepPerson2);
        deepPerson2.money = new Money(26000);
        System.out.println(deepPerson1);
        System.out.println(deepPerson2);
    }
}
